#include <stdio.h>
#include <math.h>
int main(int argc, char *argv[]) {

    int n, k;
    while (scanf("%d %d",&n,&k)!=EOF)
    {
        int ou = 0, qi = 0;
        for (int i = n; i <= k; i++)
        {
            if(i%2==0)
                ou += pow(i, 2);
            else
                qi += pow(i, 3);
        }
        printf("%d %d\n", ou, qi);
    }
    

    return 0;
}